<template>
	<view class="content">
		<swiper class="swiperBox">
			<swiper-item class="swiperItem" v-for="(item,index) in data.banner" :key="index">
				<image :src="item.url" class="swiperItem"></image>
			</swiper-item>
		</swiper>
		<view class="navigationBox">
			<view class="nameBox">
				<text>{{data.name}}</text>
				<text>￥{{data.price}}</text>
			</view>
			<view class="addressBox">
				<text>容纳人数 ：{{data.num}}人</text>
				<text style="margin-top: 25rpx;">地  址 ：{{data.address}}</text>
				<image :src="baseUrl+'img/juanjiahui/navigation.png'" class="navigation"></image>
			</view>
		</view>
		<view class="commentBox">
			<view class="commentTop">
				<view class="commentLabel">
					评价
				</view>
				<view class="commentTotal">
					（{{comment.count}}条）
				</view>
				<view class="commentAll" @click="$navto.navto('/pages/place_evaluate/place_evaluate',{id:data.id})">
					全部 >
				</view>
			</view>
			<view class="commentItem" v-if="(comment.data || []).length > 0">
				<view class="userInfoBox">
					<image :src="comment.data[0].head" class="avatar"></image>
					<text class="name ellipsis">{{comment.data[0].name}}</text>
					<uni-rate disabled="true" :value="comment.data[0].score" size="18" color="#C4C4C4" activeColor="#000000" class="rate" />
				</view>
				<text class="commentInfo">{{comment.data[0].content}}</text>
				<view class="commentImgBox" >
					<image :src="item.url" v-for="(item,index) in thumb" :key="index" class="commentImgItem"></image>
				</view>
			</view>
		</view>
		<view class="introductionBox">
			<view class="introductionTitle">
				场地简介
			</view>
			<mp-html :content="data.details" />
		</view>
		<view class="order" @click="submit">
			立即预约
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				baseUrl: this.$baseUrl,
				data:'',
				comment:''
			}
		},
		// 查询空间详情
		onLoad(options) {
			this.$request.get(`venue_read/${options.id}`).then(res => {
				this.data = res.data.data;
			})
			this.$request.get(`venue_evaluation_list?venue_id=${options.id}`).then(res => { //获取评论
				this.comment = res.data;
			})
		},
		methods: {
			submit(){
				this.$store.commit('setTempData', this.$data);
				this.$navto.navto("/pages/juanjiahui_place_submit/juanjiahui_place_submit")
			}
		}
	}
</script>
<style lang="scss" scoped>
	.order{
		position: fixed;
		bottom: 30rpx;
		left: 40rpx;
		width: 670rpx;
		height: 90rpx;
		border-radius: 45rpx;
		background: #121212;
		font-weight: 700;
		font-size: 28rpx;
		color: #FFFFFF;
		letter-spacing: 5rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.introductionBox{
		width: 670rpx;
		padding: 50rpx 40rpx 200rpx 40rpx;
		margin-top: 25rpx;
		background-color: #ffffff;
		.introductionTitle{
			font-weight: 700;
			font-size: 26rpx;
			color: #121212;
			padding-bottom: 50rpx;
			border-bottom: 1rpx solid #121212;
			margin-bottom: 70rpx;
		}
	}
	.commentBox {
		width: 670rpx;
		padding: 50rpx 40rpx 50rpx 40rpx;
		margin-top: 25rpx;
		background-color: #ffffff;
		.commentItem {
			display: flex;
			flex-direction: column;
			margin-top: 65rpx;
			.commentImgBox {
				width: 590rpx;
				margin-left: 80rpx;
				display: flex;
				justify-content: space-between;
				flex-wrap: wrap;
				/* 允许换行 */
				margin-top: 40rpx;
	
				.commentImgItem {
					width: 138rpx;
					height: 138rpx;
					margin-bottom: 10rpx;
					border-radius: 10rpx;
				}
			}
	
			.commentInfo {
				font-weight: 500;
				width: 590rpx;
				line-height: 48rpx;
				font-size: 24rpx;
				color: #121212;
				letter-spacing: 2rpx;
				margin-left: 80rpx;
			}
	
			.userInfoBox {
				display: flex;
				align-items: center;
	
				.rate {
					margin-left: auto;
				}
	
				.name {
					font-weight: 700;
					width: 400rpx;
					font-size: 24rpx;
					color: #121212;
					margin-left: 35rpx;
				}
	
				.avatar {
					width: 43rpx;
					height: 43rpx;
				}
			}
		}
	
		.commentTop {
			display: flex;
			align-items: center;
			padding-bottom: 45rpx;
			border-bottom: 1rpx solid #121212;
	
			.commentAll {
				font-weight: 500;
				font-size: 24rpx;
				color: #8E8E8E;
				margin-left: auto;
			}
	
			.commentTotal {
				font-weight: 500;
				font-size: 24rpx;
				color: #121212;
			}
	
			.commentLabel {
				font-weight: 700;
				font-size: 26rpx;
				color: #121212;
			}
		}
	}
	.navigationBox{
		padding: 65rpx 40rpx 65rpx 40rpx;
		box-sizing: border-box;
		background-color: #ffffff;
		.addressBox{
			margin-top: 60rpx;
			font-weight: 500;
			font-size: 20rpx;
			color: #121212;
			display: flex;
			flex-direction: column;
			position: relative;
			.navigation{
				position: absolute;
				width: 21rpx;
				height: 21rpx;
				right: 0;
				bottom: 0;
			}
		}
		.nameBox{
			display: flex;
			font-weight: 700;
			font-size: 32rpx;
			color: #121212;
			justify-content: space-between;
		}
	}
	.swiperBox{
		width: 750rpx;
		height: 750rpx;
		.swiperItem{
			width: 100%;
			height: 100%;
		}
	}
	.content {
		width: 100%;
		height: 100%;
		background-color: #f0f0f0;
	}
</style>